<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
	
	<!-- Claudio Herreros, Dylan James, Tyler Berg -->
	
		<link rel="stylesheet" type="text/css" href="styles.css" title="Style 1"/>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Create Account</title>
		<script type="text/javascript">
			function checkFields(form)
			{
				if (form.FullName.value == "")
				{
					alert("Please enter your Full Name.");
					form.FullName.focus();
					return false;
				}
		
				if (form.UserName.value == "")
				{
					alert("Please enter your User Name.");
					form.UserName.focus();
					return false;
				}
		
				if (form.Password.value == "")
				{
					alert("Please enter a password.");
					form.Password.focus();
					return false;
				}
		
				if (form.Password2.value == "")
				{
					alert("Please re-enter your password.");
					form.Password2.focus();
					return false;
				}
		
				if (form.Password.value != form.Password2.value)
				{
					alert("Passwords do not match.");
					form.Password2.focus();
					return false;
				}
		
				return true;
			}
		</script>
	</head>
	
	<body>
		<h1>Create new Account</h1>
		<hr/>	
				<%
					if (request.getAttribute("errorMessage") != null)
					{
				%>
						<div style="color:red" align="center"> <strong>
						<%= request.getAttribute("errorMessage") %>
						</strong></div> <br />
				<%
						request.removeAttribute("errorMessage");
					}
				%>
		<form action="/CreateAccount" method="post" onsubmit="return checkFields(this);">
		    <table align="center"  border="0" cellspacing="0" cellpadding="5">
		    	<tr>
		        <td class="FieldLabel" >Full Name: </td>
		        <td><input name="FullName" type="text" value="" size="40" /></td>
		      </tr>
		      <tr>
		        <td class="FieldLabel">User Name: </td>
		        <td><input name="UserName" type="text" value="" size="40" /></td>
		      </tr>
		      <tr>
		        <td class="FieldLabel">Password:</td>
		        <td><input name="Password" type="password" value="" size="40" /></td>
		      </tr>
		            <tr>
		        <td class="FieldLabel">Re-Enter Password:</td>
		        <td><input name="Password2" type="password" value="" size="40" /></td>
		      </tr>
		    </table>
		  <div align="center"><input type="submit" value="Create" /></div>
		</form>
			<hr/>
			<a href="index.html">Back!</a>
	</body>
</html>
